#ifndef __CTRL_FMU_H__
#define __CTRL_FMU_H__

#include "ctrl_basic.h"

typedef struct
{
    uint16_t St;          // 0xAA

		uint8_t PID_Updata;
		float PID_ROLL_P;
		float PID_ROLL_I;
		float PID_ROLL_D;
     	float PID_ROLL_DD;
		float PID_PIT_P;
		float PID_PIT_I;
		float PID_PIT_D;
		float PID_PIT_DD;
		float PID_YAW_P;
		float PID_YAW_I;
		float PID_YAW_D;
		float Roll;
		float PIT;
		float YAW;

    int16_t Alt_Sonar;    // Height in cm

    
    uint16_t Sp;                  // 0x55
}Msg_FMUToCtrl_Pkg_t;


typedef union
{
    Msg_FMUToCtrl_Pkg_t Pkg;
    uint8 Buf[sizeof(Msg_FMUToCtrl_Pkg_t)];
}Msg_FMUToCtrl_t;

typedef struct
{
    uint16 St;      // 0xAAAA
    
    int16 Rol;      // -4500        0       4500
    int16 Pit;      // -4500        0       4500
    int16 Alt;      // 0            550     1000
    int16 Yaw;      // -4500        0       4500    

/*	uint16 En_Yaw;
	uint16 Expect_Yaw;*/
	uint16 Stop_Sign;
	
	 uint16 Sp;      // 0x5555
}Msg_CtrlToFMU_Pkg_t;

typedef union
{
    Msg_CtrlToFMU_Pkg_t Pkg;
    uint8 Buf[sizeof(Msg_CtrlToFMU_Pkg_t)];
}Msg_CtrlToFMU_t;



extern Msg_FMUToCtrl_t Msg_FMUToCtrl;
extern Msg_CtrlToFMU_t Msg_CtrlToFMU;

extern YesNo_t En_Update_Alt_Sample;
extern YesNo_t AutoCtrl_RC_Ch6;
extern YesNo_t AutoCtrl_HeightAbove_35cm;

extern YesNo_t Msg_FMU_To_Ctrl_Update(void);

#endif  // __CTRL_FMU_H__

